
package gov.chinatax.ctcps.generator.form;

import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for xtglXtpz.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="xtglXtpzForm"
 */
public class XtglXtpzForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _pzbh = null;
   private java.lang.String _pzmc = null;
   private java.lang.String _pzlxDm = null;
   private java.lang.String _qyBz = null;
   private java.lang.String _pzcs = null;
   private java.lang.String _bz = null;
   private java.lang.String _zt1 = null;
   private java.lang.String _zt2 = null;

   /**
    * Standard constructor.
    */
   public XtglXtpzForm() {
   }

   /**
    * Returns the pzbh
    *
    * @return the pzbh
    */
   public java.lang.String getPzbh() {
      return _pzbh;
   }

   /**
    * Sets the pzbh
    *
    * @param pzbh the new pzbh value
    */
   public void setPzbh(java.lang.String pzbh) {
      _pzbh = pzbh;
   }
   /**
    * Returns the pzmc
    *
    * @return the pzmc
    */
   public java.lang.String getPzmc() {
      return _pzmc;
   }

   /**
    * Sets the pzmc
    *
    * @param pzmc the new pzmc value
    */
   public void setPzmc(java.lang.String pzmc) {
      _pzmc = pzmc;
   }
   /**
    * Returns the pzlxDm
    *
    * @return the pzlxDm
    */
   public java.lang.String getPzlxDm() {
      return _pzlxDm;
   }

   /**
    * Sets the pzlxDm
    *
    * @param pzlxDm the new pzlxDm value
    */
   public void setPzlxDm(java.lang.String pzlxDm) {
      _pzlxDm = pzlxDm;
   }
   /**
    * Returns the qyBz
    *
    * @return the qyBz
    */
   public java.lang.String getQyBz() {
      return _qyBz;
   }

   /**
    * Sets the qyBz
    *
    * @param qyBz the new qyBz value
    */
   public void setQyBz(java.lang.String qyBz) {
      _qyBz = qyBz;
   }
   /**
    * Returns the pzcs
    *
    * @return the pzcs
    */
   public java.lang.String getPzcs() {
      return _pzcs;
   }

   /**
    * Sets the pzcs
    *
    * @param pzcs the new pzcs value
    */
   public void setPzcs(java.lang.String pzcs) {
      _pzcs = pzcs;
   }
   /**
    * Returns the bz
    *
    * @return the bz
    */
   public java.lang.String getBz() {
      return _bz;
   }

   /**
    * Sets the bz
    *
    * @param bz the new bz value
    */
   public void setBz(java.lang.String bz) {
      _bz = bz;
   }
   /**
    * Returns the zt1
    *
    * @return the zt1
    */
   public java.lang.String getZt1() {
      return _zt1;
   }

   /**
    * Sets the zt1
    *
    * @param zt1 the new zt1 value
    */
   public void setZt1(java.lang.String zt1) {
      _zt1 = zt1;
   }
   /**
    * Returns the zt2
    *
    * @return the zt2
    */
   public java.lang.String getZt2() {
      return _zt2;
   }

   /**
    * Sets the zt2
    *
    * @param zt2 the new zt2 value
    */
   public void setZt2(java.lang.String zt2) {
      _zt2 = zt2;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getPzbh() == null) {
         errors.add("pzbh", new ActionError("error.pzbh.required"));
      }
      if(getPzmc() == null) {
         errors.add("pzmc", new ActionError("error.pzmc.required"));
      }
      if(getPzlxDm() == null) {
         errors.add("pzlxDm", new ActionError("error.pzlxDm.required"));
      }
      if(getQyBz() == null) {
         errors.add("qyBz", new ActionError("error.qyBz.required"));
      }
      // TODO test format/data
      return errors;
   }
}
